/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: #333;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
    margin: 0;
    font-size: 2.2rem;
}

.app-header p {
    margin: 10px 0 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.app-footer {
    background-color: #343a40;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
}

.task-editor-app {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.command-panel,
.task-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.panel-header p {
    margin: 5px 0 0;
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* 命令面板 */
.command-panel {
    flex: 0 0 300px;
}

.command-list {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.command-list h3 {
    font-size: 1.1rem;
    color: #3498db;
    margin: 15px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.command-category {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 任务面板 */
.task-panel {
    flex: 1;
}

.task-tree {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
}

/* 命令卡片 */
.command-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    cursor: move;
    transition: all 0.2s ease;
    border: 1px solid #eaeaea;
}

.command-card:hover {
    background: #edf2f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.command-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.command-type {
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    background-color: #e3f2fd;
    color: #1976d2;
}

.command-type.control {
    background-color: #fff8e1;
    color: #ff8f00;
}

.command-content {
    display: flex;
}

.command-description {
    font-size: 0.95rem;
    color: #555;
}

/* 任务卡片 */
.task-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid #eaeaea;
    transition: all 0.2s ease;
}

.task-card.control {
    border-left: 3px solid #ff9800;
}

.task-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.task-header {
    padding: 12px 15px;
}

.task-info {
    flex: 1;
}

.task-children {
    padding-left: 25px;
    margin-top: 8px;
}

.task-target,
.task-value,
.task-description {
    font-size: 0.95rem;
    margin-top: 5px;
}

.task-target {
    color: #d35400;
    font-weight: 500;
}

.task-value {
    color: #27ae60;
}

.task-description {
    color: #555;
    margin-top: 8px;
}

/* 任务操作按钮 */
.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.edit-btn,
.delete-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.edit-btn {
    background-color: #e3f2fd;
    color: #1976d2;
}

.delete-btn {
    background-color: #ffebee;
    color: #d32f2f;
}

.edit-btn:hover {
    background-color: #bbdefb;
}

.delete-btn:hover {
    background-color: #ffcdd2;
}

/* 任务编辑表单 */
.task-editor {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.save-btn,
.cancel-btn {
    padding: 6px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.save-btn {
    background-color: #4caf50;
    color: white;
}

.cancel-btn {
    background-color: #f5f5f5;
    color: #333;
}

.save-btn:hover {
    background-color: #388e3c;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}

/* 拖拽指示器 */
.drop-indicator-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.drop-indicator-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: transparent;
    z-index: 100;
}

.drop-indicator-before {
    top: 0;
}

.drop-indicator-after {
    bottom: 0;
}

.drop-indicator-line.active {
    background-color: #2196f3;
    height: 3px;
}

.drop-indicator-area {
    position: absolute;
    top: 25%;
    bottom: 25%;
    left: 0;
    right: 0;
    border: 2px dashed transparent;
    border-radius: 8px;
}

.drop-indicator-area.active {
    border: 2px dashed #4caf50;
    background-color: rgba(76, 175, 80, 0.1);
}

/* 拖拽效果 */
.draggable-item {
    cursor: move;
}